/**
 * 
 */
aquire = false;
function onFirstSuccess(position)
{
	alert(position.coords.latitude + "  "+position.coords.longitude);
	document.FormTraining.startTraining.disabled=false;
}

function onFirstError(error)
{
	alert(error.code +"  "+error.message);	
}

function startGPSFix()
{
	if(aquire==false)
	{
		navigator.geolocation.getCurrentPosition(onFirstSuccess, onFirstError, {enableHighAccuracy: true});	
	}
}

function aquireGPSData()
{
	aquire=true;
	navigator.geolocation.watchPosition(onSuccess, onError, {timeout:5000,enableHighAccuracy: true});
}
function onSuccess(position)
{
	var body = document.getElementById("b");
	body.innerHTML += "latitude:" +position.coords.latitude+", longitude: "+position.coords.longitude+", altitude: "+position.coords.altitude+", speed: "+position.coords.speed;
	//document.write("latitude:" +position.coords.latitude+", longitude: "+position.coords.longitude+", altitude: "+position.coords.altitude+", speed: "+position.coords.speed);
}
function onError(error)
{
	alert(error.code+"  "+error.message);
}